#include "qrsagsmapflashplugin.h"
#include "qgsmaptoolpan.h"

QRSAGSMapFlashPlugin::QRSAGSMapFlashPlugin(QgsMapCanvas *mapCanvas, QgsLayerTreeView * layerTreeVeiw)
{
    this->mMapCanvas = mapCanvas;
    this->mMapFlashTool = new QRSAGSMapFlashTool(mapCanvas, layerTreeVeiw);
}

QRSAGSMapFlashPlugin::~QRSAGSMapFlashPlugin()
{
    delete this->mMapCanvas;
    delete this->mMapFlashTool;
}

void QRSAGSMapFlashPlugin::unload()
{
    this->mMapCanvas->unsetMapTool(this->mMapFlashTool);
    this->mMapCanvas->refresh();
}

void QRSAGSMapFlashPlugin::run()
{
    if(this->mMapCanvas->mapTool() != this->mMapFlashTool){
        this->mMapCanvas->setMapTool(this->mMapFlashTool);
    }
}
